package Routes

import (
	"work1/Controllers"

	"github.com/gin-gonic/gin"
)

func Api(r gin.Engine) {
	RouteApi := r.Group("/api")
	RouteApi.GET("/test", new(Controllers.TestController).Index)
	RouteApi.GET("/tasks", new(Controllers.TaskController).Index)
	RouteApi.GET("/tasks_change_status", new(Controllers.TaskController).ChangeStatus)
	RouteApi.GET("/check_server_status", new(Controllers.ServerController).CheckLockStatus)
	RouteApi.GET("/check_domain_status", new(Controllers.DomainController).CheckLockStatus)

	RouteApi.GET("/checks/base_soft", new(Controllers.ServerController).BaseSoft)

	RouteApi.GET("/configure/ssl", new(Controllers.ServerController).ConfigureSSL)

	RouteApi.POST("/record_server/:server_id", new(Controllers.ServerController).Update)
	RouteApi.PUT("/record_server/:server_id", new(Controllers.ServerController).Update)
	RouteApi.PATCH("/record_server/:server_id", new(Controllers.ServerController).Update)
}
